-- background: 2744 from stack: in.0 -- bmap block id: 3186 -- flags: 4000 -- background id: 0 -- name: Stack Dumper -- part 7 (field) -- low flags: 01 -- high flags: 2004 -- rect: left=5 top=7 right=94 bottom=329 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 24 -- style flags: 256 -- line height: 30 -- part name: -- part 8 (field) -- low flags: 01 -- high flags: 0007 -- rect: left=5 top=101 right=337 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: -- part 3 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=474 top=0 right=25 bottom=512 -- title width / last selected line: 0 -- icon id / first selected line: 20098 / 20098 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp go home end mouseUp -- part 9 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=339 top=65 right=96 bottom=506 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Dump scripts ----- HyperTalk script ----- on mouseUp global SDFileout, msgloc push card pop card into SDCard -- don't leave it in the stack in case -- the target stack clobbers it lock screen get the loc of msg put it into msgloc set the loc of msg to 22, -30 go to "the stack to dump" -- this will put of the Standard File dialog with -- "where is "the stack to dump" -- BUG: the stack is dumped even if the user selects "cancel" put "Dumped Scripts Data" into defaultName put StandardFile("put", defaultName) into SDFileout if SDFileout is empty then go to SDCard QuitDump exit mouseUp end if open file SDFileout get ChangeFileType(SDFileout, "TEXT", "MSWD") set cursor to busy -- dump the stack properties and script writestr "Item"&tab&"Name"&tab&"Props"&tab&"Script"&return get "Stack" & tab & short name of this stack & tab put "Dumping scripts of"&&it into msg writestr it writestr StackProperties() & tab dumpScripts this, Stack -- now dump each background put number of backgrounds into Nbg repeat with i = 1 to Nbg go first cd of bg i get "Background " & i & tab & short name of this bg & tab put it into msg writestr it writestr BgProperties() & tab dumpScripts this, Background -- now dump each bg button and each bg field dumpScripts Background, button dumpScripts Background, field -- dump each card within this background put number of cards of this bg into Ncd repeat with j = 1 to Ncd go to card j of this bg put CdProperties() into CdProps if CDProps & the script of this card is empty then next repeat get "Card "&j&" of background "&i&": "&short name of this bg& " (card "&number of this card&")"& tab & short name of this cd & tab & CdProps & tab put it into msg writestr it dumpScripts this, Card dumpScripts Card, button dumpScripts Card, field end repeat end repeat close file SDFileout go to SDCard QuitDump end mouseUp on dumpScripts place, object if place is "this" then do "get the script of this "&object if it is empty then writestr "" else WriteScript(it) writestr return else do "put the number of "&place&&object&"s into Nob" if Nob > 0 then put place&&object&&Nob into msg repeat with i = 1 to Nob do "get the script of "&place&&object&&i if it is empty then next repeat do "put the short name of "&place&&object&&i&" into theName" writestr place&&object&&i&tab&theName&tab writestr Visible(place, object, i) & tab WriteScript(it) writestr return end repeat end if end if end dumpScripts Function StackProperties return plural(number of cards, "card") & "; " & plural(number of backgrounds, "background") & "." end StackProperties Function BgProperties return plural(number of cards of this bg, "card") & "; " & plural(number of bg buttons, "background button") & "; " & plural(number of bg fields, "background field") & "." end BgProperties Function CdProperties put number of cd fields into NFlds put number of cd buttons into NBtns if Nflds = 0 and NBtns = 0 then return empty return plural(NBtns, "card button") & "; " & plural(NFlds, "card field") & "." end CdProperties Function Visible place, object, n do "get the visible of "&place&&object&&n if it is true then return "Visible." else return "Hidden." end Visible -- part 10 (button) -- low flags: 00 -- high flags: 8003 -- rect: left=340 top=31 right=62 bottom=504 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Dump fields ----- HyperTalk script ----- on mouseUp global SDFileout, msgloc push card pop card into SDCard -- don't leave it in the stack in case -- the target stack clobbers it get the loc of msg put it into msgloc set the loc of msg to 22, -30 go to "the stack to dump" put number of backgrounds into n repeat with i = 1 to n put 0 into SDNfields go first cd of bg i put the number of bg fields into NFields put the short name of this background into BgName put "Background "&i&": "&BgName&& (number of cards of this bg) && "cards," && Nfields && "bg fields" into msg beep if Nfields = 0 then answer "This background has no bg fields." with "ok" next repeat end if answer "Dump cards of this background?" with "yes" or "no" or "cancel" if it is "no" then next repeat if it is "cancel" then exit repeat put StandardFile("put", BgName & ".text") into SDFileout if SDFileout is empty then exit repeat open file SDFileout get ChangeFileType(SDFileout, "TEXT", "MSWD") repeat with j = 1 to Nfields writestr "Field" & j if j = NFields then writestr return else writestr tab end repeat lock screen repeat with c = 1 to (number of cards of this bg) set cursor to busy go to card c of this bg dumpBgFields Nfields end repeat unlock screen close file SDFileout end repeat go to SDCard QuitDump end mouseUp on dumpBgFields Nfields repeat with i = 1 to Nfields WriteText(bg field i) if i ≠ Nfields then writestr tab else writestr return end repeat put the number of this card into msg end dumpBgFields